import _ from 'lodash';

export default function baidu(pathname, query, dispatch) {
  // _hmt.push(['_trackPageview', '/virtual/login'])
  dispatch({ type: 'auth/baidu', payload: { pathname, query } });
  if (_.isNil(pathname)) return;
  if (pathname === '/p1' || pathname === '/p6' || pathname === '/p5') {
    return _hmt.push(['_trackPageview', `/task/${query.taskType}`]);
  }
  _hmt.push(['_trackPageview', pathname]);
}
